<%@ page contentType="text/html; charset=utf-8" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/tr/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>公告通知</title>
<link href="../style/main.css" rel="stylesheet" type="text/css" />
<link type="text/css" rel="stylesheet"  href="../style/style.css" />

<style type="text/css">
<!--
body{ padding:10px}
.STYLE1 {color: #333333}
.STYLE2 {font-family: Arial, Helvetica, sans-serif}
.STYLE3 {color: #FF0000}
.STYLE4 {color: #0000FF}
.STYLE5 {color: #666666}
.STYLE6 {color: #CCCCCC}
-->
</style>

<%@ taglib prefix="s" uri="/struts-tags" %>

<script type="text/javascript">
	function newNotice()
	{
		editNoticeDiv.style.display = "";
	}
	function closeEdit()
	{
		editNoticeDiv.style.display = "none";
	}
	function startEdit(id)
	{
		var number = searchNoticeForm.pageNumber.value;
		var size = searchNoticeForm.pageSize.value;
		if(id != null && id.length > 0)
		{
			document.location = "notice!startEdit?noticeId="+id+"&page.pageNumber="+number+"&page.pageSize="+size;
		}
	}
	function removeNotice(id)
	{
		var number = searchNoticeForm.pageNumber.value;
		var size = searchNoticeForm.pageSize.value;
		if(id != null && id.length > 0)
		{
			document.location = "notice!removeNotice?noticeId="+id+"&page.pageNumber="+number+"&page.pageSize="+size;
		}
	}
	function gotoPage(page)
	{
		if(page == 0)
		{
			searchNoticeForm.pageNumber.value = document.getElementById("t_pageNumber").value;
			searchNoticeForm.pageSize.value = document.getElementById("t_pageSize").value;
		}
		else
		{
			searchNoticeForm.pageNumber.value = page;
		}
		searchNoticeForm.submit();
	}
</script>
<script type="text/javascript" src="../ckeditor/ckeditor.js"></script>
</head>

<body>
<div class="mainarea">
<div class="search">
	<table width="100%" border="0" align="left" cellpadding="0" cellspacing="2" class="table4" >
    	<tr bgcolor="#BBD2F7">
        	<th height="25" colspan="5" class="title">
            	公告通知
            </th>
            <th>
            	<span style="color:#666">[<a href="javascript:newNotice();">发布公告</a>]</span>
            </th>
        </tr>
        <tbody>
          <tr>
            <td bordercolor="#FF00FF" bgcolor="#FAFBDC"><span class="STYLE1"></span></td>
            <td width="45%" height="25" align="left" bordercolor="#FF00FF" bgcolor="#FAFBDC"><span style="color:#666">公告通知标题</span></td>
            <td width="15%" bordercolor="#FF00FF" bgcolor="#FAFBDC"><span style="color:#666">发布时间</span></td>
            <td width="15%" height="25" bordercolor="#FF00FF" bgcolor="#FAFBDC"><span style="color:#666">通告发布人 </span>                                 </td>
            <td width="15%" bordercolor="#FF00FF" bgcolor="#FAFBDC"><span style="color:#666">发布部门</span></td>
            <td width="10%" bordercolor="#FF00FF" bgcolor="#FAFBDC"><span style="color:#666">操作</span></td>
          </tr>
          <s:iterator value="#request.noticeList" status="st" id="noticeList">
	          <tr>
	            <td bgcolor="#FFFFFF">&nbsp;</td>
	            <td height="25" align="left" bgcolor="#FFFFFF">
	            	<a href="notice!showNotice?noticeId=<s:property value='noticeid' />">
	            	<span style="color:#000">
	            		<s:property value="noticeTitle"/>
	            	</span>
	            	</a>
	            </td>
	            <td height="25" bgcolor="#FFFFFF">
	            	<span style="color:#000">
	            		<s:date name="noticeDate" format="yyyy-MM-dd HH:mm:ss"/>
	            	</span>
	            </td>
	            <td height="25" bgcolor="#FFFFFF">
	            	<span style="color:#000">
	            		<s:property value="employee.employeeNameC"/>
	            	</span>
	            </td>
	            <td height="25" bgcolor="#FFFFFF">
	            	<span style="color:#000">
	            		<s:property value="employee.department.departmentId"/>
	            	</span>
	            </td>
	            <td height="25" bgcolor="#FFFFFF">
	            	<a href="notice!startEdit?noticeId=<s:property value='noticeid' />">
	            		<span style="color:#000">修改</span>
	            	</a>&nbsp;&nbsp;
	            	<a href="notice!removeNotice?noticeId=<s:property value='noticeid' />">
	            		<span style="color:#000">删除</span>
	            	</a>
	            </td>
	          </tr>
          </s:iterator>
        </tbody>
    </table>
</div>
    <s:form name="searchNoticeForm" action="notice!showNoticeList" method="post">
    	<s:hidden id="pageNumber" name="page.pageNumber" />
    	<s:hidden id="pageSize" name="page.pageSize" />
    </s:form>
    <table width="100%" cellpadding="0" cellspacing="0" class="dg_pagestyle">
        <tr>
            <td class="pageinfo">
                	第<s:property value="page.pageNumber"/>页 | 共<s:property value="page.totalPage"/>页
            </td>
            <td class="pagebutton">
                每页
                <s:select id="t_pageSize" name="page.pageSize" 
                			list="{'10','20','30','40','50'}" theme="simple">
                </s:select>
                条记录 | 第
                <s:textfield id="t_pageNumber" name="page.pageNumber" cssStyle="width: 20px;" theme="simple" />
                页
                <a onclick="javascript:gotoPage(0);" href="javascript:void(0);">
                	<img src="../images/btn_go.gif" />
                </a>
                <a onclick="javascript:gotoPage(1);" href="javascript:void(0);">
                	<img src="../images/btn_sy.gif" width="55" height="20" />
                </a>
                <a onclick="javascript:gotoPage(<s:property value='page.prePage' />);" 
                		href="javascript:void(0);">
                	<img src="../images/btn_syy.gif" width="55" height="20" />
                </a>
                <a onclick="javascript:gotoPage(<s:property value='page.nextPage' />);" 
                		href="javascript:void(0);">
                	<img src="../images/btn_xyy.gif" width="55" height="20" />
                </a>
                <a onclick="javascript:gotoPage(<s:property value='page.lastPage' />);" 
                		href="javascript:void(0);">
                	<img src="../images/btn_wy.gif" width="55" height="20" />
                </a>
            </td>
        </tr>
    </table>
<div class="clear"></div>
<div id="editNoticeDiv" class="search" style="width:100%; display:none">
	<s:form id="notice" name="notice" action="notice!releaseNotice" method="post" theme="simple">
    	<table width="100%" border="0" align="left" cellpadding="0" cellspacing="2" class="table4" >
    	<s:hidden name="page.pageNumber" />
    	<s:hidden name="page.pageSize" />
        	<tr>
            	<th height="25" colspan="3" bgcolor="#BBD2F7" class="title">发布公告</th>
            </tr>
            <tr height="50px">
            	<th width="60px">标题：</th>
                <td width="700px"><s:textfield id="noticeTitle" name="notice.noticeTitle" cssStyle="width:500px"/></td>
                <td></td>
            </tr>
            <tr>
            	<th valign="top" width="60px">正文：</th>
                <td><s:textarea id="noticeContent" name="notice.noticeContent" cols="100" rows="20"></s:textarea></td>
                <td></td>
            </tr>
            <tr>
            	<td></td>
            	<td align="right">
            		<s:submit cssStyle="width:60px" value="发布" />
            		<input type="button" onclick="javascript:closeEdit();" style="width:60px" value="取消" />
            	</td>
                <td></td>
            </tr>
        </table>
		<script type="text/javascript"> 
		   CKEDITOR.replace('noticeContent'); 
		</script> 
        
    </s:form>
</div>
</div>
</body>
</html>
